<!-- Shortcuts:
TODO: review end days of months (30 or 31?)
 -->
<script type="text/javascript">
function listSpentToday() {
	date = new Date();
	dString = date.getFullYear() + '-' + (date.getMonth()+1) + '-' + date.getDate();
	$('#spentList').load('/cassaco/spent/list/1/' + dString);
}

function listSpentYesterday() {
	today = new Date();
	yday = new Date(today - (24*60*60*1000));
	dString = yday.getFullYear() + '-' + (yday.getMonth()+1) + '-' + yday.getDate();
	$('#spentList').load('/cassaco/spent/list/1/' + dString);
}

function listSpentThisMonth() {
	date = new Date();
	d1String = date.getFullYear() + '-' + (date.getMonth()+1) + '-' + 1;
	d2String = date.getFullYear() + '-' + (date.getMonth()+1) + '-' + 31;
	$('#spentList').load('/cassaco/spent/list/1/' + d1String + '/' + d2String);
}

function listSpentLastMonth() {
	date = new Date();
	d1String = date.getFullYear() + '-' + (date.getMonth()) + '-' + 1;
	d2String = date.getFullYear() + '-' + (date.getMonth()) + '-' + 30;
	$('#spentList').load('/cassaco/spent/list/1/' + d1String + '/' + d2String);
}

function listSpentThisYear() {
	date = new Date();
	d1String = date.getFullYear() + '-' + 1 + '-' + 1;
	d2String = date.getFullYear() + '-' + 12 + '-' + 31;
	$('#spentList').load('/cassaco/spent/list/1/' + d1String + '/' + d2String);
}

function listSpentLastYear() {
	date = new Date();
	d1String = date.getFullYear()-1 + '-' + 1 + '-' + 1;
	d2String = date.getFullYear()-1 + '-' + 12 + '-' + 31;
	$('#spentList').load('/cassaco/spent/list/1/' + d1String + '/' + d2String);
}

function listSpentAll() {
	$('#spentList').load('/cassaco/spent/list/1/');
}
</script>
<a style="cursor: pointer;" onclick="listSpentYesterday();">Yesterday</a> | 
<a style="cursor: pointer;" onclick="listSpentToday();">Today</a> | 
<a style="cursor: pointer;" onclick="listSpentThisMonth();">This month</a> | 
<a style="cursor: pointer;" onclick="listSpentLastMonth();">Last month</a> | 
<a style="cursor: pointer;" onclick="listSpentThisYear();">This year</a> | 
<a style="cursor: pointer;" onclick="listSpentLastYear();">Last year</a> |
<a style="cursor: pointer;" onclick="listSpentAll();">All</a>